<template>
    <up-overlay :show="modelValue" width="525rpx">
        <view class="modal-container">
            <view class="modal-wrap">
                <view class="modal-title">{{ title }}</view>
                <view class="modal-content">{{ content }}</view>
                <view class="modal-btns">
                    <sc-button type="grey-blue" width="187" height="60" text="取消" @click="cancel"></sc-button>
                    <sc-button type="primary" width="187" height="60" text="确定" @click="confirm"></sc-button>
                </view>
            </view>
        </view>
    </up-overlay>
</template>

<script setup>
const props = defineProps({
    modelValue: {
        type: Boolean,
        default: false
    },
    title: {
        type: String,
        default: '标题'
    },
    content: {
        type: String,
        default: '内容'
    }
})
const emit = defineEmits(['update:modelValue', 'confirm'])

const cancel = () => {
    emit('update:modelValue', false)
}
const confirm = () => {
    emit('update:modelValue', false)
    emit('confirm')
}
</script>

<style lang="scss" scoped>
.modal-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-wrap {
    padding: 15rpx 52rpx 30rpx;
    width: 525rpx;
    background: #FFFFFF;
    border-radius: 8rpx;
    display: flex;
    flex-direction: column;
    align-items: center;

    .modal-title {
        font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
        font-weight: 400;
        font-size: 30rpx;
        color: #3D3D3D;
        line-height: 77rpx;
    }

    .modal-content {
        text-align: center;
        width: 326rpx;
        font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
        font-weight: 400;
        font-size: 26rpx;
        color: rgba(61, 61, 61, 0.8);
        line-height: 38rpx;
    }

    .modal-btns {
        display: flex;
        column-gap: 45rpx;
        margin-top: 33rpx;
    }
}
</style>